<template>
  <div class="app-container">
    <el-form ref="form" :model="carbelong" label-width="120px">
      <el-form-item label="住户id">
        <el-input v-model="carbelong.uid"/>
      </el-form-item>
      <el-form-item label="车辆id">
        <el-input v-model="carbelong.cid"/>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit(carbelong)">新增爱车</el-button>
        <el-button @click="onCancel">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import request from '@/utils/request'

export default {
  data() {
    return {
      carbelong: {
        uid: '',
        cid: ''
      }

    }
  },
  methods: {
    /*onSubmit() {
      // 请求接口 实现用户新增接口的调用
      request({
        url: "http://127.0.0.1:8080/api/user/carbelong/save.do",
        method: "POST",
        data: this.carbelong
      }).then(res => {
        if (res.code == 0) {
          //跳转到列表页面
          /!* this.$store.commit("user/setCarBelong", carbelong);
           this.$router.push("/lovelycardetail");*!/
          /!*this.$router.push({path: "/lovelycardetail", query: {msg: uid}});*!/
        }
      })
    }*/
    onSubmit(obj) {
      //请求接口 实现数据的查询
      this.listLoading = true
      this.$router.push({path: "/lovelycardetail", query: {msg: obj.uid}});
    },
    checkPass() {
    }
    ,
    onCancel() {
      this.$message({
        message: '取消住户的新增',
        type: 'warning'
      })
    }
  }
}
</script>

<style scoped>
.line {
  text-align: center;
}
</style>
